package org.korifey.ffbdd.impl.graph;

import java.io.IOException;
import java.io.OutputStream;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.List;

import org.korifey.ffbdd.api.IBdd;
import org.korifey.ffbdd.api.INode;

public class DOTPrinter {
	private final static byte[] START = "digraph X\nrankdir=TB;\n".getBytes();
	private final static byte[] END = "}\n".getBytes();
	private final static MessageFormat RANK_FORMAT = new MessageFormat("{rank={0); {1};}\n");
	private final static String RANK_MIN = "min";
	private final static String RANK_SAME = "same";
	private final static String RANK_MAX = "max";
	
	private IBdd bdd;
	
	public DOTPrinter(IBdd bdd) {
		this.bdd = bdd;
	}
	
	public void print(OutputStream out) throws IOException {
		List<Integer> varsL = bdd.dependantVariables();
		
		Integer[] vars = varsL.toArray(new Integer[0]);
		Arrays.sort(vars);
		List<INode> nodes = bdd.listNodes();
		
		out.write(START);
		for (INode n: nodes) {
			
		}
		
	}
}
